package com.googlecode.connectlet.crypto.cipher.rc5;

import com.googlecode.connectlet.crypto.cipher.CipherFactory;

public class RC564CipherFactory implements CipherFactory {
	private static RC564CipherFactory instance = new RC564CipherFactory();

	public static RC564CipherFactory getInstance() {
		return instance;
	}

	private int nRounds;

	private RC564CipherFactory() {
		this(RC564Cipher.DEFAULT_ROUNDS);
	}

	public RC564CipherFactory(int nRounds) {
		this.nRounds = nRounds;
	}

	@Override
	public int getBlockSize() {
		return RC564Cipher.BLOCK_SIZE;
	}

	@Override
	public RC564Cipher getEncipheror(byte[] key) {
		return new RC564Cipher(nRounds, key);
	}

	@Override
	public RC564Cipher getDecipheror(byte[] key) {
		return new RC564Cipher(nRounds, key);
	}
}